//////////////Start NoShow Page ////////////////
var oldObjArrayNoShow = new Array();
function searchAll_NoshowResvPage(value,e){
	/*if (e.keyCode == 13 && !e.ctrlKey) {
		getReservationRoomNoShowManageMent("textSearch",value);
		$("#SearchAll_NoshowResvPage").val("");
	}*/
}
function getReservationRoomNoShowManageMent(data,valueSearch){
	clearData();
	waitingDialog({});
	var searchName = $("#SearchAll_NoshowResvPage").val();
	if($("#RowpagerNoShowListRoomManageMent").val() == null){
		getCurrentTabData().lineNoShow = 10;
	}else{
		getCurrentTabData().lineNoShow = $("#RowpagerNoShowListRoomManageMent").val();
	}
	if($("#pagerNoShowListRoomManageMent").val() == null){
		var pagePointer = 1; 
	}else{
		if(valueSearch!=""&&valueSearch!=undefined){
			var pagePointer = valueSearch; 
		}else{
			var pagePointer = 1;
			getCurrentTabData().pagerNumber = 1;
		}
		//var pagePointer = $("#pagerNoShowListRoomManageMent").val(); 
	}
	var offfset = (getCurrentTabData().lineNoShow*pagePointer)-getCurrentTabData().lineNoShow;
	var dataOld =  $("#typeCheckReservationNoShow").val();
	var valueDateCheckin = $("#calendar_btw_checkinNoshow").attr("dateofBtwCheckinNoshow");
	var valueDateCheckout = $("#calendar_btw_checkoutNoShow").attr("dateofBtwCheckoutNoshow");
	if(valueDateCheckin!=""&&valueDateCheckout!=""){
		var dateCheckin = $("#calendar_btw_checkinNoshow").attr("dateofBtwCheckinNoshow");
	  	var dateCheckout = $("#calendar_btw_checkoutNoShow").attr("dateofBtwCheckoutNoshow");
	  	$("#calendar_btw_checkinNoshow").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutNoShow").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinNoshow').attr('dateofBtwCheckinNoshow',dateCheckin);
		$('#calendar_btw_checkoutNoShow').attr('dateofBtwCheckoutNoshow',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;
	}else{
		var dateCheckin = new Date().toSystemFormat();
		var dateCheckout= new Date().toSystemFormat();
		$("#calendar_btw_checkinNoshow").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutNoShow").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinNoshow').attr('dateofBtwCheckinNoshow',dateCheckin);
		$('#calendar_btw_checkoutNoShow').attr('dateofBtwCheckoutNoshow',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;
	}
	if(data=="NoShowListRoomManageMent"){
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationNoShow&offset="
				+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&SearchAll_checkoutPage="+searchName;
			var linkSet = "/reservationService?func=getReservationNoShow&offset="
				+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&SearchAll_checkoutPage="+searchName;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
		}else{
			getCurrentTabData().beforePageNoShow = ""; 
			getCurrentTabData().beforeSubPageNoShow = "";
			var link = "/reservationService?func=getReservationNoShow&offset="
				+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&SearchAll_checkoutPage="+searchName;
			simpleservice(link,null,showDataResRoomNoShowManageMent,data);
		}
		//var link = "/reservationService?func=getReservationNoShow";
		//simpleservice(link,null,showDataResRoomNoShowManageMent,data);
	}else if(data=="G"){
		getCurrentTabData().typeReservationNoShow = data;
		typeReservationNoshowFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomNoShowManageMent(data,"G");
	}else if(data=="S"){
		getCurrentTabData().typeReservationNoShow = data;
		typeReservationNoshowFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomNoShowManageMent(data,"S");
	}else if(data=="A"){
		getCurrentTabData().typeReservationNoShow = data;
		typeReservationNoshowFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomNoShowManageMent(data,"A");
	}else if(data == "textSearch"){
		showDataResRoomNoShowManageMent("textSearch","textSearch");
	}else if(data == "dateSearch"){
		var dataOld =  $("#typeCheckReservationNoShow").val();
		var valueDateCheckin = $("#calendar_btw_checkinNoshow").attr("dateofBtwCheckinNoshow");
		getCurrentTabData().valueDateCheckin = valueDateCheckin;
		getCurrentTabData().valueDateCheckout = valueDateCheckout;
		var valueDateCheckout = $("#calendar_btw_checkoutNoShow").attr("dateofBtwCheckoutNoshow");
		if(valueDateCheckin!=""&&valueDateCheckout!=""){
			var dateCheckin = $("#calendar_btw_checkinNoshow").attr("dateofBtwCheckinNoshow");
			var dateCheckout= $("#calendar_btw_checkoutNoShow").attr("dateofBtwCheckoutNoshow");
			if(dataOld=="G"){
				getCurrentTabData().typeReservationNoShow = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationNoShowGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationNoShowGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
				}else{
					getCurrentTabData().beforePageNoShow = ""; 
					getCurrentTabData().beforeSubPageNoShow = "";
					var link = "/reservationService?func=getReservationNoShowGroup&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomNoShowManageMent,data);
				}
				//var link = "/reservationService?func=getReservationNoShowGroup&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomNoShowManageMent,data);
			}else if(dataOld=="S"){
				getCurrentTabData().typeReservationNoShow = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationNoShowSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationNoShowSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
				}else{
					getCurrentTabData().beforePageNoShow = ""; 
					getCurrentTabData().beforeSubPageNoShow = "";
					var link = "/reservationService?func=getReservationNoShowSingle&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomNoShowManageMent,data);
				}
				//var link = "/reservationService?func=getReservationNoShowSingle&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomNoShowManageMent,data);
			}else if(dataOld=="A"){
				getCurrentTabData().typeReservationNoShow = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationNoShow&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationNoShow&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
				}else{
					getCurrentTabData().beforePageNoShow = ""; 
					getCurrentTabData().beforeSubPageNoShow = "";
					var link = "/reservationService?func=getReservationNoShow&offset="
						+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomNoShowManageMent,data);
				}
				//var link = "/reservationService?func=getReservationNoShow&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomNoShowManageMent,data);
			}
		}else{
			$("#calendar_btw_checkinNoshow").select();
		}
	}
}
function showDataResRoomNoShowManageMent(data,output){
	var valueDateCheckin = getCurrentTabData().valueDateCheckin;
	var valueDateCheckout = getCurrentTabData().valueDateCheckout;
	if(valueDateCheckin!=""&&valueDateCheckout!=""){
		var dateCheckin = valueDateCheckin;
	  	var dateCheckout = valueDateCheckout;
	  	$("#calendar_btw_checkinNoshow").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutNoShow").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinNoshow').attr('dateofBtwCheckinNoshow',dateCheckin);
		$('#calendar_btw_checkoutNoShow').attr('dateofBtwCheckoutNoshow',dateCheckout);
	}
	// set for pager
	getCurrentTabData().tablePager = "tablepagingNoShow";
	getCurrentTabData().pagerNumberField = "pagerNoShowListRoomManageMent";
	getCurrentTabData().functionGetData = "getReservationRoomNoShowManageMent";
	getCurrentTabData().pageName = "NoShowListRoomManageMent";
	getCurrentTabData().pageNavPosition = "pageNavPositionNoShow";
	getCurrentTabData().trCheck = "trNoShow";
	
	if(getCurrentTabData().checkinPendingCheckin!=undefined){
		$('#calendar_btw_checkinNoshow').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().checkinPendingCheckin).getFormatedString());
		$('#calendar_btw_checkinNoshow').attr('dateofBtwCheckinNoshow',getCurrentTabData().checkinPendingCheckin);
	}
	if(getCurrentTabData().checkinPendingCheckout!=undefined){
		$('#calendar_btw_checkoutNoShow').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().checkinPendingCheckout).getFormatedString());
		$('#calendar_btw_checkoutNoShow').attr('dateofBtwCheckoutNoshow',getCurrentTabData().checkinPendingCheckout);
	}
	if(getCurrentTabData().typeReservationNoShow!=undefined){
		$('#typeCheckReservationNoShow option[value='+getCurrentTabData().typeReservationNoShow+']').attr('selected', 'selected');
	}
	
	if(data.trim()=="[]"){
		var textDataEmpty = '<tr clearTr="noShowReservation" >'+
		'<td colspan="100%" style="text-align:center;" >'+
		dataEmpty+
		'</td>'+
		'</tr>';
		textNoShow = textDataEmpty;
		$("[clearTr=noShowReservation]").remove();
		$("#NoShowRoomManageMent_Id_Tr").replaceWith("<tr id=NoShowRoomManageMent_Id_Tr ></tr>"+textNoShow);
		textNoShow = '';
	}else{
		$("[clearTr=noShowReservation]").remove();
		var objArray = new Array();
		if((data=="textSearch"||data=="G"||data=="S"||data=="A")&&data!="dateSearch"){
			objArray 	= oldObjArrayNoShow;
			objArray = objArray[0];
		}else{
			objArray 	= JSON.parse(data);
			oldObjArrayNoShow = objArray;
			objArray = objArray[0];
		}
		var numberSet = getCurrentTabData().beforePageNoShow; 
		var numberSubSet = getCurrentTabData().beforeSubPageNoShow;
		sortIdRoommanagement(objArray);
		textNoShowPrint = '';
		var checkBgColor = 0;
		var countGroup = 0;
		var OldGroupId =0;
		var valueSearch = $("#SearchAll_NoshowResvPage").val();
		var typeReservation =  $("#typeCheckReservationNoShow").val();
		var firstSelect = "";
		var CheckIn = '<a href="javascript:void();" onClick="javascript:alert()">'+BtnCheckinTemp+'</a>';
		var Cancel = '<a href="javascript:void();" >'+BtnCancelTemp+'</a>';
		for(var i =0;i<objArray.length;i++){
			
			if(objArray[i].name!=""&&objArray[i].name!=undefined){
				var nameReservation = objArray[i].name.split(" ");
			}else{
				var nameReservation = "";
			}
			var Objtitle = objArray[i].reservationTitle;
			var ObjgroupId = objArray[i].groupId;
			var ObjId = objArray[i].id;
			var checkContinue = checkedFilter(output,valueSearch,nameReservation,firstSelect,Objtitle,ObjgroupId,typeReservation,ObjId);
			if(checkContinue==1){
				continue;
			}
			if(objArray[i].groupId!="0"){
				if(objArray[i].subList!=undefined){
					//	OldGroupId = objArray[i].groupIdString;
						var setDateFormat = new Date(objArray[i].date);
						var setFateFormatCheckout = setDateFormat.addDate(objArray[i].span);
						groupId = objArray[i].groupIdString;
						var splitResIdInGroup = objArray[i].resList.split(",");
						var textSubRes = "";
						var checkBgColorG =0;
						var StatusResInGroup = "";
						var textSubResPrint = "";
						for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
							var DescriptionSubRes = "";
							if(objArray[i].subList[subRes].description!=undefined&&objArray[i].subList[subRes].description!=""){
								DescriptionSubRes = objArray[i].subList[subRes].description;
							}else{
								DescriptionSubRes = "";
							}
							var setDateFormatRes = new Date(objArray[i].subList[subRes].date);
							var setFateFormatCheckoutRes = setDateFormatRes.addDate(objArray[i].subList[subRes].span);
							var ShowNameGuest = "";
							/// Name Empty
							if(objArray[i].subList[subRes].name!=undefined){
								ShowNameGuest = objArray[i].subList[subRes].name
							}
							///
							if(objArray[i].subList[subRes].reservationTitle=="Reserved Rooms"){
								StatusResInGroup = statusResv;
							}else if(objArray[i].subList[subRes].reservationTitle=="Checked-out Rooms"){
								StatusResInGroup = statusCheckOut;
							}else if(objArray[i].subList[subRes].reservationTitle=="Temp Rooms"){
								StatusResInGroup = statusTempResv;
							}else if(objArray[i].subList[subRes].reservationTitle=="Cancel Reservation"){
								StatusResInGroup = statusCancel;
							}else{
								StatusResInGroup = statusCheckin;
							}
							if(checkBgColorG==0){
								statusRecord = 'dataRecordBot';
								checkBgColorG = 1;
							}else{
								statusRecord = 'dataRecordBot';
								checkBgColorG =0;
							}
							var showDisplayGuestname = "";
							if(ShowNameGuest==""){
								showDisplayGuestname = '<tr clearTr=noShowReservation class="'+statusRecord+'"  onclick="if(linkClick==true)noGuestName();"  id="btnEditS" >';
							}else{
								showDisplayGuestname = '<tr clearTr=noShowReservation class="'+statusRecord+'" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')"  id="btnEditS" >';
							}
							var runnumberSub = "";
							if(getCurrentTabData().beforePageNoShow!=undefined&&getCurrentTabData().beforePageNoShow!=""){
								runnumberSub = (numberSet+1)+"."+(subRes+1);
							}else{
								runnumberSub = (i+1)+"."+(subRes+1);
							}
								textSubRes += showDisplayGuestname+
								'<td colspan="2" class="spanDataCenter">'+
								runnumberSub+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+objArray[i].subList[subRes].id+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="guestName" >'+ShowNameGuest+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].subList[subRes].span+'</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
									'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									StatusResInGroup+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+toCurrencyString(objArray[i].subList[subRes].totaltax)+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].subList[subRes].ChargeCheckTemp))+'</div></span>'+
								'</td>'+
									'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
								'</td>'+
								'</tr>';
								textSubResPrint += '<tr clearTr="noShowReservation" class="dataRecord" onclick="if(linkClick&&ShowNameGuest!="") CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')"  id="btnEditS" >'+
								'<td colspan="2" class="spanDataCenter">'+
								runnumberSub+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+objArray[i].subList[subRes].id+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="guestName" >'+ShowNameGuest+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].subList[subRes].span+'</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
									'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									StatusResInGroup+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+toCurrencyString(objArray[i].subList[subRes].totaltax)+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].subList[subRes].ChargeCheckTemp))+'</div></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
								'</td>'+
								'</tr>';
							}
							var obj = objArray[i].subList;
							showStatusResInGroup = checkStatusReservationGroup(obj);
							if(getCurrentTabData().beforePageNoShow!=undefined&&getCurrentTabData().beforePageNoShow!=""){
								numberSet = numberSet+1;
								number = numberSet;
							}else{
								number = (i+1);
							}
							textNoShow += '<tr clearTr="noShowReservation" class="dataRecordGroup" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].groupIdString+')" id="btnEditG" >'+
							'<td class="spanDataCenter">'+
							number+'(<span id=groupCount'+objArray[i].groupIdString+' >'+objArray[i].resList.split(",").length+'</span>)'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>G'+objArray[i].groupIdString+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="ownerName" >'+objArray[i].name+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
							'</td>'+
							'<td class="spanDataCenter">' +
								
							'</td>'+
							'<td class="spanDataCenter">'+
							'<span>'+showStatusResInGroup+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
							'</td>'+
						'</tr>'+textSubRes;
							textNoShowPrint += '<tr clearTr="noShowReservation" class="dataRecordGroup" onclick="if(linkClick) CallEditReservedPageWithLoadElement('+objArray[i].groupIdString+',id)" id="groupShow'+objArray[i].groupIdString+'" >'+
							'<td class="spanDataCenter">'+
							number+'(<span id=groupCount'+objArray[i].groupIdString+' >'+objArray[i].resList.split(",").length+'</span>)'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>G'+objArray[i].groupIdString+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span class="ownerName" >'+objArray[i].name+'</span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
							'</td>'+
							'<td class="spanDataCenter"> '+
							'</td>'+
							'<td class="spanDataCenter">' +
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
								'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
							'</td>'+
							'<td class="spanDataCenter">'+
							'</td>'+
						'</tr>'+textSubResPrint;
							checkBgColor =1;
				}else{
					var DescriptionSubRes = "";
					if(objArray[i].description!=undefined&&objArray[i].description!=""){
						DescriptionSubRes = objArray[i].description;
					}else{
						DescriptionSubRes = "";
					}
					var setDateFormatRes = new Date(objArray[i].date);
					var setFateFormatCheckoutRes = setDateFormatRes.addDate(objArray[i].span);
					var ShowNameGuest = "";
					/// Name Empty
					if(objArray[i].name!=undefined){
						ShowNameGuest = objArray[i].name
					}
					///
					if(objArray[i].reservationTitle=="Reserved Rooms"){
						StatusResInGroup = statusResv;
					}else if(objArray[i].reservationTitle=="Checked-out Rooms"){
						StatusResInGroup = statusCheckOut;
					}else if(objArray[i].reservationTitle=="Temp Rooms"){
						StatusResInGroup = statusTempResv;
					}else if(objArray[i].reservationTitle=="Cancel Reservation"){
						StatusResInGroup = statusCancel;
					}else{
						StatusResInGroup = statusCheckin;
					}
					if(checkBgColorG==0){
						statusRecord = 'dataRecordBot';
						checkBgColorG = 1;
					}else{
						statusRecord = 'dataRecordBot';
						checkBgColorG =0;
					}
					var showDisplayGuestname = "";
					if(ShowNameGuest==""){
						showDisplayGuestname = '<tr clearTr=noShowReservation class="'+statusRecord+'"   id="btnEditS" >';
					}else{
						showDisplayGuestname = '<tr clearTr=noShowReservation class="'+statusRecord+'" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')"  id="btnEditS" >';
					}
					var runnumberSub = "";
					if(getCurrentTabData().beforePageNoShow!=undefined&&getCurrentTabData().beforePageNoShow!=""){
						runnumberSub = (numberSet)+"."+(numberSubSet);
						numberSubSet = numberSubSet+1;
					}else{
						runnumberSub = (i+1)+"."+(subRes+1);
					}
						textNoShow += showDisplayGuestname+
						'<td colspan="2" class="spanDataCenter">'+
						runnumberSub+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+ShowNameGuest+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].span+'</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							StatusResInGroup+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(objArray[i].totaltax)+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].ChargeCheckTemp))+'</div></span>'+
						'</td>'+
							'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
						'</td>'+
						'</tr>';
						textNoShowPrint += '<tr clearTr="noShowReservation" class="dataRecord" onclick="if(linkClick&&ShowNameGuest!="") CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')"  id="btnEditS" >'+
						'<td colspan="2" class="spanDataCenter">'+
						runnumberSub+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+ShowNameGuest+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' / '+objArray[i].span+'</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							StatusResInGroup+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(objArray[i].totaltax)+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].ChargeCheckTemp))+'</div></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
						'</td>'+
						'</tr>';
				}
			}else{
				res = objArray[i].id;
				var setDateFormat = new Date(objArray[i].date);
				var setFateFormatCheckout = setDateFormat.addDate(objArray[i].span);
				getStatusResInGroup = objArray[i].reservationTitle;
				if(getStatusResInGroup=="Reserved Rooms"){
					showStatusResInGroup = statusResv;
				}else if(getStatusResInGroup=="Checked-out Rooms"){
					showStatusResInGroup = statusCheckOut;
				}else if(getStatusResInGroup=="Temp Rooms"){
					showStatusResInGroup = statusTempResv;
				}else if(getStatusResInGroup=="Cancel Reservation"){
					showStatusResInGroup = statusCancel;
				}else{
					showStatusResInGroup = statusCheckin;
				}
				if(setDateFormat.getFormatedString()!=undefined){
					if(checkBgColor==0){
						statusRecord = 'dataRecordBot';
						checkBgColor = 1;
					}else{
						statusRecord = 'dataRecordBot';
						checkBgColor =0;
					}
					if(getCurrentTabData().beforePageNoShow!=undefined&&getCurrentTabData().beforePageNoShow!=""){
						numberSet = numberSet+1;
						number = numberSet;
					}else{
						number = (i+1);
					}
						textNoShow += '<tr clearTr="noShowReservation" class="'+statusRecord+'" onclick="if(linkClick){CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}" id="btnEditS">'+
						'<td class="spanDataCenter" >'+
						number+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
						'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+showStatusResInGroup+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(objArray[i].totaltax)+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].ChargeCheckTemp))+'</div>'+
						'</td>'+
							'<td class="spanDataCenter"><div class="fongwordwarp" >'+objArray[i].description+'</div>'+
						'</td>'+
					'</tr>';
						textNoShowPrint += '<tr clearTr="noShowReservation" class="dataRecord" onclick="if(linkClick){CreateMenu('+objArray[i].id+',id)}" id="singleShow'+objArray[i].id+'">'+
						'<td class="spanDataCenter" >'+
						number+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' / '+objArray[i].span+'</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
						'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+showStatusResInGroup+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(objArray[i].totaltax)+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<div class="fongwordwarp" >'+toCurrencyString(currencyStringToNumber(objArray[i].ChargeCheckTemp))+'</div>'+
						'</td>'+
							'<td class="spanDataCenter"><div class="fongwordwarp" >'+objArray[i].description+'</div>'+
						'</td>'+
					'</tr>';
				}
			}
		}
		if(textNoShow==""){
			var textDataEmpty = '<tr clearTr="noShowReservation" >'+
			'<td colspan="100%" style="text-align:center;" >'+
			dataEmpty+
			'</td>'+
			'</tr>';
			textNoShow = textDataEmpty;
		}
		$("#NoShowRoomManageMent_Id_Tr").replaceWith("<tr id=NoShowRoomManageMent_Id_Tr ></tr>"+textNoShow);
		textNoShow = "";
		textSubRes = "";
		textPrint = textNoShowPrint;
	}
	dateRoomManageMent({checkin:"calendar_btw_checkinNoshow",atrcheckin:"dateofBtwCheckinNoshow"},{checkout:"calendar_btw_checkoutNoShow",atrcheckout:"dateofBtwCheckoutNoshow"});
	$(".ui-datepicker-trigger").css("margin-top","2px");
	closeWaitingDialog();
	showDataResRoomManageMentSetPageNoShow(data,getCurrentTabData().lineNoShow);
}

function showDataResRoomManageMentSetPageNoShow(data,output){
	$("[clearTr*=noshowReservationPage]").remove();
	objArray = JSON.parse(data);
	objArray = objArray[1];
	var textRoomNoShowSetpage = "";
	for(var i =0;i<objArray.length;i++){
		var textSubRes = "";
		if(objArray[i].groupId!="0"){
			var statusRecord = "";
			for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
				textSubRes += '<tr clearTr=noshowReservationPage  ><td></td></tr>';
			}
			textRoomNoShowSetpage += '<tr clearTr=noshowReservationPage class="trNoShow"><td></td></tr>'+textSubRes;
		}else{
			textRoomNoShowSetpage += '<tr clearTr=noshowReservationPage ><td></td></tr>';
		}
	}
	$("[name = NoShowRoomManageMent_Id_Tr2]").replaceWith("<tr name=NoShowRoomManageMent_Id_Tr2></tr>"+textRoomNoShowSetpage);
	textRoomNoShowSetpage = "";
	textSubRes = "";
	showPager(output);
}

function showDataResRoomManageMentSetCountNoShow(data,output){
	var subCount = 0;
	var recCount = 0;
	var objArray = new Array();
	if((data=="textSearch"||data=="G"||data=="S"||data=="A"||data=="reservationType_A"||data=="Checked-out Rooms"||data=="Checked-in Rooms")&&data!="dateSearch"){
		objArray = oldObjArrayCheckin;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}else{
		objArray = JSON.parse(data);
		oldObjArrayCheckin = objArray;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}
	setRowObjArrayCheckin = objArray;
	sortIdRoommanagement(objArray);
	sortIdRoommanagement(objArrayCheck);
	for(var i =0;i<objArray.length;i++){
		if(objArray[i].groupId!="0"){
			if(objArray[i].subList!=undefined){
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					subCount = objArrayCheck[objArrayCheck.length-1].subList.length+1;
					break;
				}
			}else{
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					break;
				}
			}
		}else{
			if(objArrayCheck[objArrayCheck.length-1].id==objArray[i].id){
				recCount = (i+1);
				break;
			}
		}
	}
	getCurrentTabData().beforePageNoShow = (recCount);
	getCurrentTabData().beforeSubPageNoShow = subCount;
	simpleservice(getCurrentTabData().linkSet,null,showDataResRoomNoShowManageMent,data);
}

function typeReservationNoshowFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data){
	if(dataOld=="G"){
		getCurrentTabData().typeReservationNoShow = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationNoShowGroup&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationNoShowGroup&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
		}else{
			getCurrentTabData().beforePageNoShow = ""; 
			getCurrentTabData().beforeSubPageNoShow = "";
			var link = "/reservationService?func=getReservationNoShowGroup&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomNoShowManageMent,data);
		}
	}else if(dataOld=="S"){
		getCurrentTabData().typeReservationNoShow = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationNoShowSingle&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationNoShowSingle&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
		}else{
			getCurrentTabData().beforePageNoShow = ""; 
			getCurrentTabData().beforeSubPageNoShow = "";
			var link = "/reservationService?func=getReservationNoShowSingle&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomNoShowManageMent,data);
		}
	}else if(dataOld=="A"){
		getCurrentTabData().typeReservationNoShow = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationNoShow&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationNoShow&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountNoShow,getCurrentTabData().lineNoShow);
		}else{
			getCurrentTabData().beforePageNoShow = ""; 
			getCurrentTabData().beforeSubPageNoShow = "";
			var link = "/reservationService?func=getReservationNoShow&offset="+offfset+"&line="+getCurrentTabData().lineNoShow+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomNoShowManageMent,data);
		}
	}
}